package org.linlinjava.litemall.wx.web;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.models.Issue;
import org.linlinjava.litemall.db.service.IssueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wx/issue")
@Validated
public class WxIssueController {
    @Autowired
    private IssueService issueService;

    /**
     * 帮助中心
     */
    @GetMapping("/list")
    public Object list(String question,
                       @RequestParam(defaultValue = "1") Integer page,
                       @RequestParam(defaultValue = "10") Integer size) {
        IPage<Issue> issueList = issueService.querySelective(question, page, size);
        return ResponseUtil.ok(issueList);
    }

}
